package myschool.myshchool15.homework;

import java.util.Scanner;
/**登录*/
public class LogInSan {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String username;
        int password;
        for (int i = 2; i >= 0 ; i--) {
            System.out.println("请输入用户名：");
            username = input.next();
            System.out.println("请输入密码：");
            password = input.nextInt();
            if(username.equals("jim") && password == 123456 ){
                System.out.println("欢迎登录MyShopping系统！");
                break;
            }
            System.out.println("输入错误！您还有"+i+"次机会！");
            if(i == 0){
                System.out.println("对不起，您3次军输入错误！");
            }

        }
    }
}
